//
//  RecommendCategoryCell.swift
//  HLSwiftWork
//
//  Created by hulinhu on 2018/6/16.
//  Copyright © 2018年 hulinhu. All rights reserved.
//

import UIKit

class RecommendCategoryCell: UITableViewCell {
    
    @IBOutlet weak var redView: UIView!
    @IBOutlet weak var categoryLabel: UILabel!
    var model:RecommendCategoryModel! {
        didSet{
            categoryLabel.text = model.name
        }
    }

    override func awakeFromNib() {
        super.awakeFromNib()
        
        categoryLabel.adjustsFontSizeToFitWidth = true
    }
    
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
        if selected{
            categoryLabel.textColor = .red
            redView.isHidden = false
            redView.backgroundColor = UIColor.red
        }else {
            categoryLabel.textColor = .lightGray
            redView.isHidden = true
        }
        
    }

   
    
}
